package com.ymttest.business.data;

import java.io.File;
import java.util.ArrayList;

import com.ymttest.utils.TestDataManager;

public class OCRTest {
	public static void main(String args[]) {
		ArrayList<String> urls = TestDataManager.getLines("work.txt");
		urls.forEach(url->{
			String path = "";
			try {
				path = TestDataManager.DownloadFile(url);
				String px="";
				if(url.lastIndexOf('#')>0) {
					px=url.substring(0, url.lastIndexOf('#')).substring(url.lastIndexOf('.'));
				}else {
					px=url.substring(url.lastIndexOf('.'));
				}
				
				System.out.println("new file:"+path+px);
				new File(path).renameTo(new File(path+px));
//				path=path+px;
//				String matrixinfo=TestDataManager.GetMatrixInfo(path);
//				System.out.println("二维码图片:"+matrixinfo);
//				String matrixinfopath= TestDataManager.DownloadFile(matrixinfo);
//				TestDataManager.appendFileToLine("img.txt", matrixinfopath+":"+matrixinfo);
			} catch (Exception e) {
				e.printStackTrace();
			}finally {
//				if(path.length()>0) {
//					new File(path).delete();
//				}
			}
			
		});
		
	}
}
